﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="ZLCMS.Web.MemberUser.Login" %>

<%@ Import Namespace="ZLCMS.Business.Util" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <html xmlns:wb="http://open.weibo.com/wb">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>登录</title>
    <link href="/MemberUser/css/cui.css" rel="stylesheet" type="text/css" />
    <link href="/MemberUser/css/all.css" rel="stylesheet" type="text/css" />
    <link href="/MemberUser/css/member.css" rel="stylesheet" type="text/css" />

    <script src="/js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="/js/jquery.json-2.2.min.js" type="text/javascript"></script>
    <script src="/js/Common.js" type="text/javascript"></script>
    <script type="text/javascript" src="/js/validform/Validform_v5.3.2_min.js"></script>
    <link rel="stylesheet" href="/css/validform/style.css" />
    <!--微博登录start-->
   <%-- <script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js?appkey=765311252" type="text/javascript" charset="utf-8"></script>--%>
    <script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js?appkey=765311252&debug=true" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        function login(o) {    

            //判断用户是否已注册
            $("#btn_wb_login").ExecuteCommand({
                successCallBack: function (result) {

                    if (result.IsRegistered == "1") {
                            location.href = "/MemberUser/Default.aspx";
                    }
                    else if (result.IsRegistered == "-1") {
                        //提示是否绑定原有账户
                        if (confirm('是否绑定原有账户？')) {
                            //跳转绑定账户页面
                            location.href = "/MemberUser/bindaccount.aspx?type=weibo&openid=" + o.idstr;
                        }
                        else {
                            //添加新账户
                            location.href = "/MemberUser/GenerateAccount.aspx?type=weibo&openid=" + o.idstr;
                        }
                    }
                },
                errorCallback: function (errorCode, msg) {
                    alert(msg);
                }
            }, 'JudgeIsRegistered', { Type: "weibo", OpenId: o.idstr });
        }
function logout() {
    alert('logout');
}
    </script>
     <!--微博登录end-->
     <!--QQ登录start-->
     <script type="text/javascript" src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js"  data-appid="101158036"   charset="utf-8"  ></script>
    <script type="text/javascript">

        var cbLoginFun = function (oInfo, oOpts) {

            if (QC.Login.check()) {//如果已登录
                QC.Login.getMe(function (openId, accessToken) {

                    //这里做操作
                    //判断用户是否已注册
                    $("#btn_wb_login").ExecuteCommand({
                        successCallBack: function (result) {
                            //                            QC.Login.signOut()
                            if (result.IsRegistered == "1") {
                                    location.href = "/MemberUser/Default.aspx";
                            }
                            else if (result.IsRegistered == "-1") {
                                //提示是否绑定原有账户
                                if (confirm('是否绑定原有账户？')) {
                                    //跳转绑定账户页面
                                    location.href = "/MemberUser/bindaccount.aspx?type=qq&openid=" + openId;
                                }
                                else {
                                    //添加新账户
                                    location.href = "/MemberUser/GenerateAccount.aspx?type=qq&openid=" + openId;
                                }
                            }
                        },
                        errorCallback: function (errorCode, msg) {
                            alert(msg);
                        }
                    }, 'JudgeIsRegistered', { Type: "qq", OpenId: openId, AccessToken: accessToken });
                    //     alert(["当前登录用户的", "openId为：" + openId, "accessToken为：" + accessToken].join("\n"));
                });
            }
        };
    </script>
        <!--QQ登录end-->
</head>
<body style="background:#fff;">
<!--wrapper start-->
<div id="wrapper">
  <!--logo start-->
  <div class="login_logo"><a href="/default.aspx"> <img src="/MemberUser/images/logo.png"  style="width:57.9mm;height:25mm"  /></a></div>
  <!--logo end-->
    <div class="login_left"><img src="/MemberUser/images/login_leftbg.jpg" width="596" height="360" /></div>
    <div class="login_right">
    	<h2>登录商城<span>还没有商城账号？<a href="/MemberUser/RegEmail.aspx">30秒注册</a></span></h2>
<form id="Form1" runat="Server" class="registerform">
    <div><asp:TextBox ID="tb_id" placeholder="用户名/邮箱/手机号" runat="server" class="login_name" datatype="*2-30" errormsg="请填写正确的用户名/邮箱/手机号！" nullmsg="请填写用户名/邮箱/手机号！"></asp:TextBox></div>
    <div class="checktip"><span class="Validform_checktip"></span></div>
    <div><asp:TextBox ID="tb_pw" placeholder="密码" runat="server" TextMode="Password" class="login_password" datatype="*6-16" errormsg="请填写6-16位密码！" nullmsg="请填写6-16位密码！"></asp:TextBox></div>
    <div class="checktip"><span class="Validform_checktip"></span></div>
    <p><%--<input name="" type="checkbox" value="" />自动登录--%><a href="/MemberUser/sendmessage.aspx">忘记密码？</a></p>
    <asp:Button ID="Button1" class="submit" runat="server" Text="登录" onclick="Button1_Click"/>
</form>
      <div class="other">
       	<p>你也可以使用以下账号登录</p>
          <ul>
           	  <li><a href="#"><%--<img src="/MemberUser/images/qq.jpg" width="31" height="30" />QQ--%>   <span id="qqLoginBtn"></span><script type="text/javascript">
                QC.Login({
                    btnId: "qqLoginBtn"	//插入按钮的节点id
                }, cbLoginFun);
            </script></a>
           
            
              </li>
              <li><a href="#" ><%--<img src="/MemberUser/images/sina.jpg" width="30" height="30" />新浪微博--%>  <wb:login-button type="3,2" onlogin="login" onlogout="logout" id="btn_wb_login" ></wb:login-button></a>
              <%--<div id="wb_connect_btn" ></div>--%>
           
              </li>
              <%--<li><a href="#"><img src="/MemberUser/images/renren.jpg" width="29" height="30" />人人网</a></li>--%>
              <div class="clear"></div>
          </ul>
        </div>
    </div>
    <div class="clear"></div>
</div>
<!--wrapper end-->

<!--底部开始-->
<div id="footer"></div>
<!--底部结束-->

<script type="text/javascript">
    $(function () {
        $(".registerform").openValidform();
    });
</script>
</body>
</html>
